<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">


<ui:composition template="/template.xhtml">

	<ui:define name="tituloPagina">
		<p:outputLabel value="#{msgs['paginas.consulta.projetos']}" />
	</ui:define>
	
	<ui:define name="botoes">
		<p:commandButton value="Novo" action="#{projetoBean.novo}" styleClass="botaoNovo" />
		
		

	</ui:define>
	
	<ui:define name="principal">
	<p:panelGrid columns="3" style="margin-left:592px; margin-top: -18px; ">
			<p:outputLabel value="Nome: "/>
						
			<p:autoComplete value="#{projetoBean.nomeProjetoSelecionado}" dropdown="true" 
				completeMethod="#{projetoBean.complete}" queryDelay="700">	</p:autoComplete>							
			
			<p:commandButton icon="ui-icon-search" action="#{projetoBean.listarByFiltros}"
				 ajax="false" title="Pesquisar">			
			</p:commandButton>
			
		</p:panelGrid>	
		
		<br></br>
		<p:dataTable value="#{projetoBean.listaProjeto}" var="_lista" paginator="true" rows="10">
			
			<p:column headerText="Nome">
				<p:outputLabel value="#{_lista.nome}" />
			</p:column>
			
			<p:column headerText="Responsavel">
				<p:outputLabel value="#{_lista.pessoa.nome}" />
			</p:column>
			
			<p:column headerText="Descição">
				<p:outputLabel value="#{_lista.descricao}" />
			</p:column>
			
			<p:column headerText="Ações">
				<p:commandButton icon="ui-icon-pencil" title="Editar Projeto"
					action="#{projetoBean.editar}">
					<f:setPropertyActionListener target="#{projetoBean.projeto}"
						value="#{_lista}" />
				</p:commandButton>
				
				<p:commandButton icon="ui-icon-close" title="Excluir Projeto"
					action="#{projetoBean.excluir}" ajax="false">
					<f:setPropertyActionListener target="#{projetoBean.projeto}"
						value="#{_lista}" />

				</p:commandButton>
			</p:column>
			
		</p:dataTable>

	</ui:define>
</ui:composition>
</html>